import cv2

img = cv2.imread('../asset/bg_font.jpeg')
img2 = cv2.imread('../asset/bg_font.jpeg')
gray = cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY)
ret, mask = cv2.threshold(gray, 40, 255, cv2.THRESH_BINARY_INV)
result = cv2.inpaint(img, mask, 5, cv2.INPAINT_TELEA)
while True:
    cv2.imshow('img', img)
    cv2.imshow('result', result)
    key = cv2.waitKey(10)
    if key & 0xFF == ord('q'):
        break
cv2.destroyAllWindows()
